/**
 * 创建员工服务
 * @param {*} params
 * @returns
 */
const createEmployee = function (params) {
  return fetch("/api/v1/employee/create?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
/**
 * 获取员工列表服务
 * @param {*} params
 * @returns
 */
const getEmployee = function (params) {
  return fetch("/api/v1/employee/list?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
/**
 * 编辑员工服务
 * @param {*} params
 * @returns
 */
const updateEmployee = function (params) {
  return fetch("/api/v1/employee/update?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
/**
 * 删除员工服务
 * @param {*} params
 * @returns
 */
const deleteEmployee = function (params) {
  return fetch("/api/v1/employee/delete?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
export default {
  createEmployee,
  getEmployee,
  updateEmployee,
  deleteEmployee,
};
